package com.lagou.tomcat.utils;

/**
 * 创建人: yyn
 * 创建时间:2021/9/5 0:13
 */
public class ResourcesUtil {
    /**
     * 静态资源后缀
     */
    private static final String[] staticFileSuffix = {".html", ".css", ".js", ".jpg", ".png", ".gif", "mp4", "mp3",
            ".icon", ".text", ".json"};

    /**
     * 判断是否是静态资源
     * @param uri
     * @return
     */
    public static boolean isStatic(String uri) {
        for (String fileSuffix : staticFileSuffix) {
            if (uri.contains(fileSuffix)) return true;
        }
        return false;
    }
}
